package com.freemalll.merchant.service.impl.coopManagement;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.freemalll.common.core.exception.BusinessException;
import com.freemalll.merchant.domain.dto.coopManagement.AssetLogPageDto;
import com.freemalll.merchant.domain.vo.coopManagement.AssetRateLogPageVo;
import com.freemalll.merchant.service.coopManagement.MerAssetLogService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import com.freemalll.merchant.mapper.coopManagement.MerAssetLogMapper;
import com.freemalll.merchant.domain.entity.coopManagement.MerAssetLog;

/**
 * 服务层实现。
 *
 * @author songshixiong
 * @since 2025-05-19
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class MerAssetLogServiceImpl extends ServiceImpl<MerAssetLogMapper, MerAssetLog> implements MerAssetLogService {

    @Override
    public Page<AssetRateLogPageVo> operationLogPage(AssetLogPageDto dto) {
        if (!StringUtils.hasText(dto.getRelationId())) {
            throw BusinessException.businessParamsNotExist("关联主键不能为空");
        }
        return baseMapper.pageSearch(dto.page(), dto);
    }
}
